package com.ql.cloud;

import com.ql.cloud.framework.config.dao.config.mybatis.MybatisProperties;
import org.mybatis.spring.mapper.MapperScannerConfigurer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;

/**
 * 开始方法
 */
@EnableDiscoveryClient
@SpringBootApplication
@EnableHystrixDashboard
@EnableZuulProxy
public class SSOServerStart {
    private static Logger logger = LoggerFactory.getLogger(SSOServerStart.class);

    public static void main(String[] args) {
        new SpringApplicationBuilder(SSOServerStart.class).web(true).run(args);
    }

    @Bean
    public MapperScannerConfigurer mapperScannerConfigurer() {
        MapperScannerConfigurer mapperScannerConfigurer = new MapperScannerConfigurer();
        mapperScannerConfigurer.setSqlSessionFactoryBeanName("sqlSessionFactory");
        mapperScannerConfigurer.setBasePackage("com.ql.**.dao");
        return mapperScannerConfigurer;
    }
}
